<?php
namespace app\payment\model;

use think\Model;
use tp5_lib\account\model\AccountLogModel;

/**
 * 交易分成记录
 * 账户记录的扩展表
 * @property string $id 外键，交易记录ID
 * @property string $type 分成类型
 * @property string $from 分成下线
 */
class RoyaltyModel extends Model
{
    protected $table="payment_royalty";
    public function install()
    {
        $table=$this->db()->getTable();
        $sql="CREATE TABLE IF NOT EXISTS `$table` (
            `id` int(11) NOT NULL,
            `type` varchar(20) NOT NULL,
            `from` int(11) NOT NULL
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;";
        $this->db()->execute($sql);
    }
}
